const express = require("express");
const path = require("path");
const app = express();
app.get("/",(req,res)=>{
	res.sendFile(path.join(__dirname,"./07- ajax.html"))
})
app.get("/home",(req,res)=>{
	res.sendFile(path.join(__dirname,"./home.html"))
})
app.get("/sum",(req,res)=>{
	// http://127.0.0.1:8099/sum?a=1b=2
	const {a,b} = req.query;
	res.json({
		ok:1,
		sum:a/1+b/1
	})
})
app.get("/info",(req,res)=>{
	res.json({
		ok:1,
		msg:"success"
	})
})
app.listen(8099,()=>{
	console.log("success");
})